use std::fmt;
//
#[derive(Debug)]
struct MinMax(i64, i64);

impl fmt::Display for MinMax {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "({}, {})", self.0, self.1)
    }
}
#[derive(Debug)]
struct Point2D {
    x: f64,
    y: f64,
}

impl fmt::Display for Point2D {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "({}, {})", self.x, self.y)
    }
}
//
fn main() {
    println!("Display");

    let m1 = MinMax(0, 14);
    println!("Diaplay {}", m1); //Diaplay (0, 14)
    println!("Debug {:?}", m1); //Debug MinMax(0, 14)
    println!("Debug {:#?}", m1); //
                                 // Debug MinMax(
                                 // 0,
                                 // 14,
                                 // )

    let p = Point2D { x: 3.3, y: -2.2 };
    println!("Display {}", p); // Display (3.3, -2.2)
    println!("Debug {:?}", p); // Debug Point2D { x: 3.3, y: -2.2 }
}
